In a switching mode power supply with peak current control, a current flowing through an inductor is compared to a reference signal. The comparison result is used to control the ON and OFF of power switches of the switching mode power supply so as to control the power transfer. In order to achieve a steady system, an artificial ramp is added to the current flowing through the inductor before it is compared to the reference signal. But the artificial ramp will cause error between the peak of the current flowing through the inductor and the reference signal. Traditionally, the artificial ramp is varying with duty cycle of the switching mode power supply. As a result, the real peak of the current flowing through the inductor varies with the duty cycle, causing an output current of the switching mode power supply deviating from a preset value.
The present invention pertains to provide a reference signal generator which generates a reference signal adjusted by the input voltage and the duty cycle of the switching mode power supply, so as to eliminate the error caused by the artificial ramp.